package Server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import core.NativeMethods;

public class ServerListener implements Runnable{
	private Thread t;
	
	public ServerListener()
	{
		t = new Thread(this, "HostSocket");
	}
	
	public void start()
	{
		try {
			s = new ServerSocket(3200);
			NativeMethods.ShowDialog("Waiting...");
			Socket ss = s.accept();
			NativeMethods.ShowDialog("Connect to client");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		this.t.start();		
	}
	
	private ServerSocket s;
	
	@Override
	public void run()
	{		
		try
		{
			do
			{				
				Socket ss=s.accept();		
				
			}while(true);			
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}
	}
}
